package com.xzkydz.modle;


import com.xzkydz.app.MyApp;
import com.xzkydz.bean.WaterPumpBean;
import com.xzkydz.bean.WaterPumpBean.SubmitParamsBean.*;
import com.xzkydz.bean.WaterPumpBean.*;
import com.xzkydz.utils.DateUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class GetWaterPumpBean implements IGetWaterPumpBean {
    @Override
    public WaterPumpBean getWaterPumpBean(String appKey) {
        WaterPumpBean jsonRootBean = new WaterPumpBean();
        ParamsBean params = new ParamsBean("AMJ-06-SB-18-"+new Random().nextInt(1000), "zpsb");
        SubmitParamsBean submitparams = new SubmitParamsBean();
        submitparams.setJyjl(new JyjlBean());
        submitparams.setJybgsczjl(new JybgsczjlBean());
        submitparams.setExtra(new ExtraBean("AMJ-06-SB-18-078", MyApp.getInstance().zjrStr));
        submitparams.setHjcs02(new Hjcs02Bean());
        submitparams.setHjcs01(new Hjcs01Bean());
        submitparams.setHjcs03(new Hjcs03Bean());
        submitparams.setJscs(new JscsBean());
        submitparams.setZcyxgkdjysj(new ZcyxgkdjysjBean());
        submitparams.setZpsb(new ZpsbBean("AMJ-06-SB-18-078"));
        List<ScdjxncssBean> scdjxncssList = new ArrayList<>();
        List<ScsbxncssBean> scsbxncssList = new ArrayList<>();
        ScdjxncssBean scdjxncss = new ScdjxncssBean("0", "170", new Random().nextInt(100) + "", "15", "170", "00", "0.9", "0.85", "0");
        ScsbxncssBean scsbxncss = new ScsbxncssBean("170", "1", new Random().nextInt(100) + "", "1", "2", new Random().nextInt(100) + "", "0");
        //可以多传几组数据
        for (int i = 0; i < Integer.parseInt(MyApp.getInstance().numberStr); i++) {
            scsbxncss.setScsbxncsgkd(i + 1 + "");
            scsbxncssList.add(scsbxncss);
        }

        for (int i = 0; i < Integer.parseInt(MyApp.getInstance().numberStr); i++) {
            scdjxncss.setScdjxncsgkd(i + 1 + "");
            scdjxncssList.add(scdjxncss);
        }
        submitparams.setScdjxncss(scdjxncssList);
        submitparams.setScsbxncss(scsbxncssList);
        jsonRootBean.setAppkey(appKey);
        jsonRootBean.setMethod("add");
        jsonRootBean.setParams(params);
        jsonRootBean.setTimestamp(DateUtils.dataFormat());
        jsonRootBean.setSubmitParams(submitparams);
        jsonRootBean.setSign(new GetSign().getUpdataSign(jsonRootBean));
        return jsonRootBean;
    }

}
